package com.boot.controller.auth;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class BaseController {

    protected Logger logger = LoggerFactory.getLogger(BaseController.class);

    /**
     * 获取用户所拥有的权限列表
     * @return
     */
//    public List<String> getAuthentication() {
//        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
//        Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
//        List<String> list = new ArrayList<>();
//        for (GrantedAuthority grantedAuthority : authorities) {
//            logger.info("权限列表：{}", grantedAuthority.getAuthority());
//            list.add(grantedAuthority.getAuthority());
//        }
//        return list;
//    }
}
